package com.lhkj.ct.meta.admin.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lhkj.ct.base.enums.DeleteStatus;
import com.lhkj.ct.base.enums.GlobalStatus;
import com.lhkj.ct.base.mybatis.IBaseEntity;
import com.lhkj.ct.base.validator.group.ValGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *      医院员工表
 * </p>
 *
 * @author jobob
 * @since 2023-08-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TblEmployee对象", description="医院员工表")
@TableName("tbl_employee")
public class TblEmployee implements IBaseEntity<String> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @NotBlank(message = "id不能为空", groups = {ValGroups.Update.class})
    private String id;

    @ApiModelProperty(value = "工号", required = true, example = "0001")
    @NotBlank(message = "请输入医生工号", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @Length(max = 10, message = "工号不能超过{max}位数", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    private String empNo;

    @ApiModelProperty(value = "密码")
    private String password;

    @NotBlank(message = "请输入医生姓名", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @Length(max = 20, message = "姓名不能超过{max}位数", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "姓名", required = true, example = "张三")
    private String empName;

    @ApiModelProperty(value = "头像", example = "上传后服务器返回")
    private String empAvatar;

    @ApiModelProperty(value = "别称")
    private String empAlias;

    @ApiModelProperty(value = "入职日期")
    private LocalDate joinedDate;

    @ApiModelProperty(value = "职能标签")
    private String empLabels;

    @ApiModelProperty(value = "电子签名")
    private byte[] empSignature;

    @ApiModelProperty(value = "医生简介")
    private String empProfile;

    @ApiModelProperty(value = "联系电话")
    private String contactPhone;

    @ApiModelProperty(value = "住址")
    private String address;

    @Deprecated
    @ApiModelProperty(value = "单位职务")
    private String unitPosition;

    @Deprecated
    @ApiModelProperty(value = "职称类别")
    private String dutiesCategory;

    @ApiModelProperty(value = "职称级别")
    private String dutiesLevel;

    @ApiModelProperty(value = "职称名称")
    private String dutiesName;

    @ApiModelProperty(value = "岗位")
    private String empPost;

    @NotBlank(message = "请选择任职科室", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "任职科室", required = true, notes = "跟机构有级联关系")
    private String deptId;

    @NotBlank(message = "请选择任职机构", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "任职机构", required = true)
    private String organId;

    @Length(max = 20, message = "拼音简码不能超过{max}位数", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "拼音简码", required = true)
    private String pyCode;

    @Length(max = 20, message = "五笔简码不能超过{max}位数", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "五笔简码", required = true)
    private String wbCode;

    @NotNull(message = "请选择状态", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "状态", required = true, example = "0", notes = "0.启用 1.禁用")
    private GlobalStatus empStatus;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人")
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "备注字段", hidden = true)
    private String remark;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "删除状态", notes = "0.未删除 1.已删除")
    private DeleteStatus delFlag;

    @TableField(exist = false)
    @NotEmpty(message = "用户角色不能为空", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    private List<String> roleIds;

}
